<%@include file="package.jsp" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%@include file="includ.jsp" %>
<%
request.setCharacterEncoding("utf-8");
long stuno=Long.parseLong(request.getParameter("stuno"));
String sname=request.getParameter("sname");
String sex=request.getParameter("sex");
String telephone=request.getParameter("telephone");
String enter=request.getParameter("enterdate");
if(enter.equals("null")){
	enter="";
}
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");

Date enterdate=(enter.equals("")?null:format.parse(enter)) ;

out.print(stuno);
out.print(sname);
StudentSerive ss=new StudentSerive();
Student stu=new Student();
stu.setSname(sname);
stu.setStuno(stuno);
stu.setSex(sex);
stu.setTelephone(telephone);
int a=ss.update(stu);
if(a>0){
	out.print("保存成功");
	response.sendRedirect("studentshow.jsp");
	return;
}else{
	out.print("保存失败");
%>	
<a herf="studentshow.jsp">查看学生信息</a> 
<% }
%>


</body>
</html>